#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <BSphere>
#include <BCylinder>
#include <BSurface>
#include <BCone>
#include <BCube>
#include <BMesh>
#include <BLight>
#include <BFont>
#include <BImage>
#include <BMaterial>
#include <BStrollHandler>
#include <BRoundHandler>
#include <BScene>
#include <BThread>
#include <BReadWrite>
#include <BCamera>
#include <BCheckBox>
#include <BRadioBox>
#include <BGridLayout>
#include <BHBoxLayout>
#include <BVBoxLayout>
#include <BViewer>
#include <BMainWindow>
#include <BDialog>
#include <BRoundHandler>
#include <BRealSpinBox>
#include <BButtonGroup>

#include "TargetHandler.h"
#include "MainHandler.h"

using namespace BWE;

class MainWindow : public BMainWindow
{
public:
	MainWindow();
	~MainWindow();

protected:
	void initScene();
	void freshParams();

protected:
	void slotOptimizedChecked(BObject* object, const BValue& value);
	void slotOrthoChecked(BObject* object, const BValue& value);
	void slotHandlerGroupChecked(BObject* object, const BValue& value);
	void slotParamsChanged();

	void slotPointSizeEdited(BObject* object, const BValue& value);
	void slotShowShapesChecked(BObject* object, const BValue& value);
	void slotShowFrustumChecked(BObject* object, const BValue& value);
	void slotShowFrustumSpaceChecked(BObject* object, const BValue& value);
	void slotOptionsHovered(BObject* object, const BValue& value);

protected:
	virtual void updateEvent(const BEvent& event);

private:
	BViewer*			_viewer;
	BViewer*			_mainViewer;
	BWidget*			_optionsWidget;

	BCheckBox*			_orthoCheckBox;
	BRealSpinBox*		_lensWidthSpinBox;
	BRealSpinBox*		_lensHeightSpinBox;
	BRealSpinBox*		_nearSpinBox;
	BRealSpinBox*		_farSpinBox;
	BRealSpinBox*		_fovySpinBox;
	BRealSpinBox*		_aspectSpinBox;

	BButtonGroup*		_handlerGroup;
	MainHandler*		_mainHandler;
	BScene*				_scene;
	BScene*				_mainScene;
	BCamera*			_camera;
	BByte				_opacity;
};

#endif